using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using TMM.Common;

namespace TMM
{
    public static class NotificationsManager
    {
        public static void RegisterForGCMNotifications(Context context)
        {
            string senders = Constants.Google.GCMSender;
            Intent intent = new Intent("com.google.android.c2dm.intent.REGISTER");
            intent.SetPackage("com.google.android.gsf");
            intent.PutExtra("app", PendingIntent.GetBroadcast(context, 0, new Intent(), 0));
            intent.PutExtra("sender", senders);
            context.StartService(intent);
        }

        public static void UnregisterFromGCMNotifications(Context context)
        {
            Intent intent = new Intent("com.google.android.c2dm.intent.UNREGISTER");
            intent.PutExtra("app", PendingIntent.GetBroadcast(context, 0, new Intent(), 0));
            context.StartService(intent);
        }
    }
}